package ynu.edu.ky_elm_springboot3.service.impl;

import ynu.edu.ky_elm_springboot3.mapper.CartMapper;
import ynu.edu.ky_elm_springboot3.po.Cart;
import ynu.edu.ky_elm_springboot3.service.CartService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;

@Service
public class CartServiceImpl implements CartService {

    @Autowired
    private CartMapper cartMapper;
    
    @Override
    public List<Cart> listCart(String userId, Integer businessId) {
        return cartMapper.listCart(userId, businessId);
    }
    
    @Override
    public int saveCart(Cart cart) {
        return cartMapper.saveCart(cart);
    }
    
    @Override
    public int updateCart(Cart cart) {
        return cartMapper.updateCart(cart);
    }
    
    @Override
    public int removeCart(String userId, Integer businessId, Integer foodId) {
        return cartMapper.removeCart(userId, businessId, foodId);
    }
} 